<?php

namespace App\Requests;

class FeatureRequest extends BaseFormRequest
{
    public function rules()
    {
        $request_key = $this->getRequestKey();
        if ($request_key == 'POST/api/feature/check_text') {
            return [
                'text' => 'required|string'
            ];
        } else if ($request_key == 'POST/api/version') {
            return [
                'platform' => 'required|in:ios,android',
                'current_version' => 'required|string',
                'build' => 'required|int',
                'force_build' => 'required|int',
                'upgrade_url' => 'nullable|url',
                'update_description' => 'nullable|string'
            ];
        }
        return [];
    }
}